Skip to content

fix(consensus): prevent timestamp overflow crash from malicious proposals#38

Merged
calbera merged 2 commits intobera-v1.xfrom
fix-timestamp-overflow
Apr 17, 2026
Merged

fix(consensus): prevent timestamp overflow crash from malicious proposals#38
calbera merged 2 commits intobera-v1.xfrom
fix-timestamp-overflow

Conversation

@calbera
Copy link
Copy Markdown
Collaborator

@calbera calbera commented Apr 16, 2026

Prevents a panic in logger (from absurdly large timestamp) which could crash consensus

@calbera calbera marked this pull request as draft April 16, 2026 08:43
@calbera calbera requested a review from a team April 16, 2026 08:43
@calbera calbera force-pushed the fix-timestamp-overflow branch from cd44b33 to 697dfa4 Compare April 16, 2026 09:39
@calbera calbera marked this pull request as ready for review April 16, 2026 09:39
@fridrik01 fridrik01 requested review from fridrik01 and removed request for fridrik01 April 16, 2026 16:22
Copy link
Copy Markdown

@fridrik01 fridrik01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

lowerBound, upperBound := cs.timelyProposalMargins()
// TODO: use Warn level once available.
// Use .String() to avoid passing a raw time.Duration to the logger,
// which can panic in some logger implementations (e.g. phuslu/log)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If thats the case, we should really switch out from phuslu in beaconkit, no need to let logger panic in that case

Comment thread internal/consensus/state.go Outdated
Co-authored-by: bar-bera <bearbaresco@berachain.com>
Signed-off-by: Cal Bera <calbera@berachain.com>
@calbera calbera merged commit 880521c into bera-v1.x Apr 17, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants